﻿using GalaSoft.MvvmLight;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DSParaView
{
    /// <summary>
    /// CtrlSortItem.xaml 的交互逻辑
    /// </summary>
    public partial class CtrlSeqNoItem : UserControl
    {

        public CtrlSeqNoItem()
        {
            InitializeComponent();
        }

        private void BtnClick_FastSet(object sender, RoutedEventArgs e)
        {
            var dx = this.DataContext as CtrlSeqNoModel;
            if (dx == null)
            {
                return;

            } 
            foreach (var item in dx.ListLevelData)
            {
                item.MinVal = dx.StartVal;  
                item.MaxVal = dx.AddIntervel;                 
            }
        }
    }

    public class CtrlSeqNoModel : ViewModelBase
    {
        private bool _IsUse;
        public bool IsUse { get => _IsUse; set => Set("IsUse", ref _IsUse, value); }

         
        private ObservableCollection<CtrlSeqNoOneLevelModel> _ListLevelData = new ObservableCollection<CtrlSeqNoOneLevelModel>();
        public ObservableCollection<CtrlSeqNoOneLevelModel> ListLevelData { get { return _ListLevelData; } set { Set("ListLevelData", ref _ListLevelData, value); } }

        private int _StartVal;
        public int StartVal { get => _StartVal; set => Set("StartVal", ref _StartVal, value); }


        private int _AddIntervel = 10;
        public int AddIntervel { get => _AddIntervel; set => Set("AddIntervel", ref _AddIntervel, value); }





    }

    public class CtrlSeqNoOneLevelModel : ViewModelBase
    {
        private int _MinVal;
        public int MinVal { get => _MinVal; set => Set("MinVal", ref _MinVal, value); }
        private int _MaxVal;
        public int MaxVal { get => _MaxVal; set => Set("MaxVal", ref _MaxVal, value); }

        private int _AtLevel;
        public int AtLevel { get => _AtLevel; set => Set("AtLevel", ref _AtLevel, value); }

        private string _Flag="<= 序列号 <";
        public string Flag { get => _Flag; set => Set("Flag", ref _Flag, value); }
    }
}